#ifndef QUAD_H
#define QUAD_H

#include <SFML/Graphics/Transformable.hpp>
#include <SFML/System/NonCopyable.hpp>
#include <memory>
#include <vector>

class SprQuad;

class Quad : public sf::Transformable, private sf::NonCopyable
{
public:
	typedef std::unique_ptr<Quad>	Ptr;
	
	enum Type
	{
	None,
	Bone,
	Sprite
	};
	
public:

	explicit				Quad(int id = 0, int timeline = 0);
	
	void					attachChild(Ptr);
	Quad::Ptr				detachChild(const Quad& spr);	
	int						getID() const;
	int						getTimeline() const;
	
	Quad*					getQuadById(int id,Type sob);
	void					setTransformByID(int id, Type sob, const sf::Vector2f& pos, float angle, const sf::Vector2f& scale);

	void					clearQuads();
	
	void					getSprites(std::vector<SprQuad*>& sprites);
	
	Type					getType();
	sf::Transform			getWorldTransform();

protected:
	Type					mType;	
	
private:
	int								mId;
	int								mTimeline;

	std::vector<Quad::Ptr>			mQuadChildren;
	Quad*							mParent;
};
#endif